package com.qqt.csr.archive.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qqt.csr.archive.entity.reader.SysUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.io.Serializable;

/**
 * @Author: yang hao
 * @Date: 2024/11/20 15:04
 * @Description: 系统用户 mapper
 **/
@Mapper
public interface SysUserMapper extends BaseMapper<SysUser> {

    @Select(value = "select su.user_id, su.dept_id, sd.dept_name, su.user_name, su.nick_name, su.job_id, su.avatar \n" +
            "from sys_user su \n" +
            "left join sys_dept sd on su.dept_id = sd.dept_id \n" +
            "where su.user_id = #{id}")
    SysUser getById(@Param("id") Serializable id);

}
